import { instance } from "./api.interceptor";
import { IUser } from "../interfaces";

export async function userControllerGetMe(): Promise<IUser> {
    const resp = await instance.get<IUser>('/user')
    return resp.data
};


export const userControllerSetRole = (
    dto: { email: string, role: string },
) => {
    return instance<void>(
        {
            url: `/user/set-role`,
            method: "put",
            headers: { "Content-Type": "application/json" },
            data: dto,
        },
    );
};
